<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>mtlb_logic</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>M2SCI function</center>
    <div align="right">Last update : 30/03/2004</div>
    <p>
      <b>mtlb_logic</b> - Matlab logical operators emulation function</p>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>Matlab and Scilab logical operator behave differently in some particular cases:</p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
	With complex operands: The <tt>
              <b>&lt;</b>
            </tt>, <tt>
              <b>&lt;=</b>
            </tt>, <tt>
              <b>&gt;</b>
            </tt> and <tt>
              <b>&gt;=</b>
            </tt> 
	operators can not be used into Scilab with complex operands, while
	in Matlab they can. And in this case, only real part of complex operands is compared.
	</li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
	With empty matrices: If both operands of <tt>
              <b>&lt;</b>
            </tt>, <tt>
              <b>&lt;=</b>
            </tt>,
	<tt>
              <b>&gt;</b>
            </tt> and <tt>
              <b>&gt;=</b>
            </tt> 
	operators are empty matrices, Scilab returns an error message, while
	Matlab returns an empty matrix. For operators <tt>
              <b>==</b>
            </tt> and <tt>
              <b>~=</b>
            </tt>,
	if at least one operand is an empty matrix, Matlab returns [] while Scilab returns a boolean value %T or %F.
	</li>
        </dd>
      </dd>
    </dl>
    <p>
    The function <tt>
        <b>mtlb_logic(A,symbol,B)</b>
      </tt> (with "symbol" a character string
    containing the operator symbol) is used by
    <tt>
        <b>mfile2sci</b>
      </tt> to replace <tt>
        <b>A symbol B</b>
      </tt> when it was not
    possible to know what were the operands while porting Matlab code to Scilab. This function will
    determine the correct semantic at run time. If you want to have a
    more efficient code it is possible to replace <tt>
        <b>mtlb_logic</b>
      </tt> calls:
    </p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>    
	If both <tt>
              <b>A</b>
            </tt> and <tt>
              <b>B</b>
            </tt> are not complex values nor empty matrices
	<tt>
              <b>mtlb_logic(A,symbol,B)</b>
            </tt> may be replaced by <tt>
              <b>A symbol B</b>
            </tt>.
	</li>
        </dd>
      </dd>
    </dl>
    <p>Caution: <tt>
        <b>mtlb_logic</b>
      </tt> has not to be used for hand coded functions.</p>
    <h3>
      <font color="blue">Authors</font>
    </h3>
    <dl>
      <dd>
        <b></b>V.C.</dd>
    </dl>
  </body>
</html>
